// 1. 导出创建 store 的方法
import { legacy_createStore as createStore, combineReducers } from 'redux'

// 将多个 reducer 合并成一个 reducer
import countReducer from './modules/count'
import proReducer from './modules/pro'

// 将多个 reducer 合并成一个 reducer
const reducer = combineReducers({
    count: countReducer,
    pro: proReducer
})


// 3. 通过创建方法和 reducer 创建一个 store
const store = createStore(reducer)


// 4. 导出 
export default store